package wli.web.util;

import java.util.Enumeration;
import java.util.Vector;

public class HtmlUtil {
	public static StringBuffer getSelect(String default_value, String name, Vector v, String selected) {
		StringBuffer sb = new StringBuffer();
		sb.append("\n<select name=" + name + " size=1  style='font-size:8pt'>");
		//sb.append("\n<option>"+default_value+"</option>");
		String temp = null;
		Enumeration enums = v.elements();
		while (enums.hasMoreElements()) {
			temp = (String) enums.nextElement();
			if (temp != null && selected != null && temp.equals(selected)) {
				sb.append("\n<option selected>" + temp + "</option>");
			} else {
				sb.append("\n<option>" + temp + "</option>");
			}
		}
		sb.append("\n</select>");
		return sb;
	}

}
